var b=new Buffer(10);
var l=b.write('abcdefg');
console.log(l, b.toString('utf8'));

var l=b.write('AABBCCDDEEFFGG');
console.log(l, b.toString('utf8'));

var l=b.write('123',7,3);
console.log(l, b.toString('utf8'));